<html>
    <head>

    </head>
    <body>
        <div id="table"></div>
        <script>
            function ab(i){
               if(i<18) document.write("未成年"+"<br />");
               else if(i==18) document.write("成年"+"<br />");
               else if(i>=0&&i<=6) document.write("童年"+"<br />");
               else if(i>=7&&i<=17) document.write("少年"+"<br />");
               else if(i>18&&i<=40) document.write("青年"+"<br />");
               else if(i>=41&&i<=65) document.write("中年"+"<br />");
               else if(i>=66)document.write("老年"+"<br />");
            }
            ab(20);
            function abc(year,moth){
                switch(moth){
                    case 1:
                    case 3:
                    case 5:
                    case 7:
                    case 8:
                    case 10:
                    case 12:return 31
                    case 2:if(year%400==0||year%4==0&&year%100!=0){
                                return 29;
                            }else{
                                return 28;
                            }
                    case 4:
                    case 6:
                    case 9:
                    case 11:return 30;
                }
            }
            document.write("2021年6月有"+abc(2021,6)+"天"+"<br />");
            

            function abcd(h,l,k,g,c){
                var table = document.createElement("table");
 
                // 创建表格行
                for (var i = 0; i < h; i++) {
                var row = document.createElement("tr");
                
                // 创建表格单元格
                for (var j = 0; j < l; j++) {
                    var cell = document.createElement("td");
                    cell.textContent = "单元格";
                    // 将单元格添加到行
                    row.appendChild(cell);
                }
                // 将行添加到表格
                table.appendChild(row);
                }
                
                // 将表格添加到文档
                var container = document.getElementById("table");
                container.appendChild(table);
            }
            abcd(4,6,4,5,3);
        </script>
    </body>
</html>